#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <vector>

#define pb push_back

using namespace std;

const int base = 1000000009;
const int key = 239;

string dig2(int x){
	string res = "";
	res += (char)('0' + x / 10);
	res += (char)('0' + x % 10);
	return res;
}

int main(){
	
	ofstream F1("file1.txt");
	ofstream F2("file2.txt");
	
	string s = "";
	int n = 10000, k = 100;
	for (int i = 0; i < n; i++) s += (char)('A' + rand() % 13);
	string t1 = "", t2 = "";
	for (int i = 0; i < k; i++){
		t1 += (char)('A' + 13 + rand() % 6);
		t2 += (char)('A' + 19 + rand() % 6);
	}
	int i = 0, j = 0;
	while (i < n || j < k){
		if ((i < n) && (j == k || rand() % 2 == 0)) F1 << s[i++] << "\n"; else F1 << t1[j++] << "\n";
	}
	i = j = 0;
	while (i < n || j < k){
		if ((i < n) && (j == k || rand() % 2 == 0)) F2 << s[i++] << "\n"; else F2 << t2[j++] << "\n";
	}
	F1.close();
	F2.close();
/*	
	ofstream out("answer00.txt");
	for (int i = 0; i < n; i++) out << s[i] << "\n";
	out.close();
*/	
	return 0;
}